/*
 * Copyright (c) 2020 Carnegie Lee
 * All rights reserved
 */
package com.geekc.zkdistributelock.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Curator属性类
 * @author Carnegie Lee
 */
@ConfigurationProperties(prefix = "curator")
@Component
public class CuratorConfigProperties {

    /** Zookeeper连接地址 */
    private String connectString;

    /** 重试连接次数（呈级联递增） */
    private int retryCount;

    /** 重试基础间隔时间，每次重试间隔时间在原来基础上增加此基础间隔时间（单位：毫秒） */
    private int baseSleepTime;

    /** 连接超时时间（单位：毫秒） */
    private int connectionTimeout;

    /** Session超时时间（单位：毫秒） */
    private int sessionTimeout;

    public CuratorConfigProperties() {}

    public String getConnectString() {
        return connectString;
    }

    public void setConnectString(String connectString) {
        this.connectString = connectString;
    }

    public int getRetryCount() {
        return retryCount;
    }

    public void setRetryCount(int retryCount) {
        this.retryCount = retryCount;
    }

    public int getBaseSleepTimeTime() {
        return baseSleepTime;
    }

    public void setBaseSleepTimeTime(int baseSleepTime) {
        this.baseSleepTime = baseSleepTime;
    }

    public int getConnectionTimeout() {
        return connectionTimeout;
    }

    public void setConnectionTimeout(int connectionTimeout) {
        this.connectionTimeout = connectionTimeout;
    }

    public int getSessionTimeout() {
        return sessionTimeout;
    }

    public void setSessionTimeout(int sessionTimeout) {
        this.sessionTimeout = sessionTimeout;
    }
}
